package dto

import (
	"github.com/gin-gonic/gin"
	"tino_manager/public"
)

type SwiperAddInput struct {
	Image    string `json:"image" form:"image" comment:"图片" validate:"required"`
	LinkType uint8  `json:"link_type" form:"link_type" gorm:"column:link_type;comment:链接类型 0通知 1场地"`
	LinkId   string `json:"link_id" form:"link_id" gorm:"column:link_id;comment:链接id"`
	Sort     int    `json:"sort" form:"sort" comment:"通知排序"`
}

func (params *SwiperAddInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type SwiperPageInput struct {
	PageSize   int `json:"page_size" form:"page_size" comment:"每页数量" validate:"required,lte=20"`
	PageNumber int `json:"page_number" form:"page_number" comment:"页码" validate:"required"`
}

func (params *SwiperPageInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type SwiperInfo struct {
	Id        string `json:"id" form:"id"`
	Image     string `json:"image" form:"image" comment:"图片" validate:"required"`
	LinkType  uint8  `json:"link_type" form:"link_type" gorm:"column:link_type;comment:链接类型 0通知 1场地"`
	LinkId    string `json:"link_id" form:"link_id" gorm:"column:link_id;comment:链接id"`
	Sort      int    `json:"sort" form:"sort"`
	Status    uint8  `json:"status" from:"status"`
	CreatedAt string `json:"created_at" form:"created_at"`
}
type SwiperPageOutput struct {
	List  []SwiperInfo `json:"list"`
	Total int64        `json:"total"`
}
type SwiperDetailInput struct {
	Id string `json:"id" form:"id" comment:"轮播图" validate:"required"`
}

func (params *SwiperDetailInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type SwiperUpdateInput struct {
	Id       string `json:"id" form:"id" validate:"required"`
	Image    string `json:"image" form:"image" comment:"图片" validate:"required"`
	LinkType uint8  `json:"link_type" form:"link_type" gorm:"column:link_type;comment:链接类型 0通知 1场地"`
	LinkId   string `json:"link_id" form:"link_id" gorm:"column:link_id;comment:链接id"`
	Sort     int    `json:"sort" form:"sort" comment:"通知排序"`
}

func (params *SwiperUpdateInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type SwiperDeleteInput struct {
	Id string `json:"id" form:"id" validate:"required"`
}

func (params *SwiperDeleteInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}
